#include "sObjectCheckbox.h"
#include "sCICheckbox.h"
#include "sGUI.h"

namespace sgui
{
namespace res
{
    const std::wstring sObjectCheckbox::OBJECT_CLASS = L"OBJCHECK";

	inst::sComponentInstance* sObjectCheckbox::getInstance(sGUI& gui, inst::sComponentInstance* parent)
	{
        inst::sComponentInstanceCheckbox* inst = dynamic_cast<inst::sComponentInstanceCheckbox*>(sComponentObject::getInstance(gui, parent));
        if (inst)
        {
            inst->setChecked(getChecked());
        }
        return inst;
	}


    void sObjectCheckbox::load(db::Record &file)
    {
        sObjectLabel::load(file);
    }

    void sObjectCheckbox::save(db::Record &file) const
    {
        sObjectLabel::save(file);
    }

    void sObjectCheckbox::clear()
    {
        sObjectLabel::clear();
    }

#ifdef _EDITOR
	void sObjectCheckbox::exportRTTI(rtti::sInfoList& list)
    {
		//REGISTER_RTTI(L"Checked", TEXT, NEW_RTTI_PARAMETER(
		//	STRING, sObjectLabel, this, &sObjectLabel::setText, &sObjectLabel::getText
		//));
    }
#endif
	
	sObjectCheckbox::sObjectCheckbox(sGUI& gui, const std::wstring& name) :
		sObjectLabel(gui, name)
    {

    }
};
};